package com.eps.entity;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author CAROLINA
 */
@Entity
@Table(name = "Estante")
@NamedQueries({@NamedQuery(name = "Estante.findAll", query = "SELECT e FROM Estante e"), @NamedQuery(name = "Estante.findByIdEstante", query = "SELECT e FROM Estante e WHERE e.idEstante = :idEstante"), @NamedQuery(name = "Estante.findByDescripcion", query = "SELECT e FROM Estante e WHERE e.descripcion = :descripcion")})
public class Estante implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_Estante")
    private Long idEstante;
    @Column(name = "descripcion")
    private String descripcion;
    @JoinColumn(name = "id_Pabellon", referencedColumnName = "id_Pabellon")
    @ManyToOne
    private Pabellon idPabellon;
    @OneToMany(mappedBy = "idEstante")
    private List<Casilla> casillaList;

    public Estante() {
    }

    public Estante(Long idEstante) {
        this.idEstante = idEstante;
    }

    public Long getIdEstante() {
        return idEstante;
    }

    public void setIdEstante(Long idEstante) {
        this.idEstante = idEstante;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public Pabellon getIdPabellon() {
        return idPabellon;
    }

    public void setIdPabellon(Pabellon idPabellon) {
        this.idPabellon = idPabellon;
    }


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEstante != null ? idEstante.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {

        if (!(object instanceof Estante)) {
            return false;
        }
        Estante other = (Estante) object;
        if ((this.idEstante == null && other.idEstante != null) || (this.idEstante != null && !this.idEstante.equals(other.idEstante))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "suministros.ejb30.entity.Estante[idEstante=" + idEstante + "]";
    }

	public void setCasillaList(List<Casilla> casillaList) {
		this.casillaList = casillaList;
	}

	public List<Casilla> getCasillaList() {
		return casillaList;
	}

}
